package com.swanclouds.redfish.managers.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.managers.Log;
import com.swanclouds.redfish.common.redfish.Status;

import java.util.List;
import java.util.Map;

public class LogServicesDetails implements Log {
    //日志资源集合的访问路径
    @JsonProperty("@odata.id")
    private String dataId;

    //日志资源集合的OData描述信息
    @JsonProperty("@odata.context")
    private String context;

    //日志资源集合的类型
    @JsonProperty("@odata.type")
    private String type;

    //日志实例信息的ID
    @JsonProperty("Id")
    private String id;

    //日志实例信息的名称
    @JsonProperty("Name")
    private String name;

    //日志实例信息的类型
    @JsonProperty("EntryType")
    private String entryType;

    //日志实例信息的日志级别
    @JsonProperty("Severity")
    private String severity;

    //日志实例信息产生的时间
    @JsonProperty("Created")
    private String created;

    //日志实例信息的时间戳
    @JsonProperty("EventTimestamp")
    private String eventTimestamp;

    //日志实例信息的类型
    @JsonProperty("EntryCode")
    private String entryCode;

    //产生日志实例信息的传感器类型
    @JsonProperty("SensorType")
    private String sensorType;

    //产生实例日志信息的传感器编号
    @JsonProperty("SensorNumber")
    private String sensorNumber;

    //日志实例信息的消息内容
    @JsonProperty("message")
    private String Message;

    @Override
    public String getDataId() {
        return this.dataId;
    }

    @Override
    public String getContext() {
        return this.context;
    }

    @Override
    public String getType() {
        return this.type;
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public Integer getMaxNumberOfRecords() {
        return null;
    }

    @Override
    public Boolean getServiceEnabled() {
        return null;
    }

    @Override
    public String getOverWritePolicy() {
        return null;
    }

    @Override
    public String getLogEntryTypes() {
        return null;
    }

    @Override
    public String getDateTime() {
        return null;
    }

    @Override
    public String getDateTimeLocalOffset() {
        return null;
    }

    @Override
    public String getDescription() {
        return null;
    }

    @Override
    public List<Status> getStatus() {
        return null;
    }

    @Override
    public Map<String, Object> getActions() {
        return null;
    }

    @Override
    public List<String> getMembers() {
        return null;
    }

    @Override
    public String getEntryType() {
        return entryType;
    }

    @Override
    public String getSeverity() {
        return severity;
    }

    @Override
    public String getCreated() {
        return created;
    }

    @Override
    public String getEventTimestamp() {
        return eventTimestamp;
    }

    @Override
    public String getEntryCode() {
        return entryCode;
    }

    @Override
    public String getSensorType() {
        return sensorType;
    }

    @Override
    public String getSensorNumber() {
        return sensorNumber;
    }

    @Override
    public String getMessage() {
        return Message;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "LogServicesDetails{" +
                "dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", entryType='" + entryType + '\'' +
                ", severity='" + severity + '\'' +
                ", created='" + created + '\'' +
                ", eventTimestamp='" + eventTimestamp + '\'' +
                ", entryCode='" + entryCode + '\'' +
                ", sensorType='" + sensorType + '\'' +
                ", sensorNumber='" + sensorNumber + '\'' +
                ", Message='" + Message + '\'' +
                '}';
    }
}
